function getCurrentTime() {
    return new Date();
  }

  function getenddTime()
  {
    return new Date('2024-8-1 14:30:00')
  }
  // 计算剩余时间
  function calculateCountdown() {
    const currentTime = getCurrentTime();
    const endTime=getenddTime();
    const timeDifference = endTime - currentTime;
    const h = Math.floor((timeDifference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    const m = Math.floor((timeDifference % (1000 * 60 * 60)) / (1000 * 60));
    const s= Math.floor((timeDifference % (1000 * 60)) / 1000);
    if(h<10){
    document.querySelector('#hour').innerHTML='0'+h;
    }
    else{
      document.querySelector('#hour').innerHTML=h;
    }
    if(m<10){
    document.querySelector('#minute').innerHTML='0'+m;
    }
    else{
      document.querySelector('#minute').innerHTML=m;
    }
    if(s<10){
    document.querySelector('#second').innerHTML='0'+s;
    }
    else{
      document.querySelector('#second').innerHTML=s;
    }
    
  }
  calculateCountdown();
  // 每隔 1 秒更新倒计时
  setInterval(calculateCountdown, 1000);
  function gotoExam()
  {
    window.location.href="../ExamWaitingPage/ExamWaitingPage.html";
  }